package jzOffer;

import java.util.Stack;

/**
 * @author 郝文雪
 * @date 2022/7/27 17:01
 * @Description Test
 */
public class JZ9 {
    Stack<Integer> stack1 = new Stack<Integer>();//主栈
    Stack<Integer> stack2 = new Stack<Integer>();//辅助栈

    public void push(int node) {
        stack1.push(node);
    }

    public int pop() {
        if(stack2.size()==0){
            while(stack1.size()!=0){
                stack2.push(stack1.pop());
            }
        }
        return stack2.pop();
    }
}
